package com.demo.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;


/**
 * @ClassName TranTemplate
 * @Description TODO
 * @Author Windy
 * @Date 2022/9/2 14:42
 * @Version 1.0
 **/
//@Configuration
//@Component
public class TranTemplate {
//    @Autowired
//    DataSource dataSource;
//
//    @Bean("jdbcTemplate")
//    public JdbcTemplate jdbcTemplate() {
//        return new JdbcTemplate(dataSource);
//    }
//    @Bean
//    public DataSourceTransactionManager dataSourceTransactionManager(){
//        DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
//        transactionManager.setDataSource(dataSource);
//        return transactionManager;
//    }
}
